x86/vmx: fix build with clang 3.8.0
authorRoger Pau Monne <roger.pau@citrix.com>
Thu, 9 Feb 2017 11:33:12 +0000 (11:33 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 9 Feb 2017 14:30:18 +0000 (14:30 +0000)
commitac6e7fd7a4826c14b85b9da59fc800a3a1bd3fd0
treee7ae6ab38fd69c610bec646af999ca4d6fdc9999
parent991033fad2cc23c45415fbcd0ab6405250e6b35c
x86/vmx: fix build with clang 3.8.0

The usage of the __transparent__ attribute in 991033fa introduces some issues
when compiled with clang 3.8.0:

xen/include/asm/hvm/vmx/vmx.h:605:15: error: transparent_union attribute can only be
      applied to a union definition; attribute ignored [-Werror,-Wignored-attributes]
typedef union __transparent__ ept_qual {
              ^
xen/include/xen/compiler.h:50:44: note: expanded from macro '__transparent__'

This can be easily fixed by moving the attribute to the end of the definition,
but then the following error triggers:

xen/include/asm/hvm/vmx/vmx.h:607:5: error: size of field '' (16 bits) does not
      match the size of the first field in transparent union; transparent_union attribute ignored
      [-Werror,-Wignored-attributes]
    struct {
    ^
xen/include/asm/hvm/vmx/vmx.h:606:19: note: size of first field is 64 bits
    unsigned long raw;
                  ^

Which can be fixed by introducing a new field in the nested structure that
contains the padding in order to match the size of an unsigned long.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/include/asm-x86/hvm/vmx/vmx.h